fix: multi-word unknown subcommand emits command_not_found (#826)#3200
Merged
Conversation
052f02d to
0236d7e
Compare
Single-word all-alpha/dash tokens that don't match any known subcommand now always emit command_not_found (with or without fuzzy suggestions). Multi-word cases fall through to CliAction::Prompt (natural language prompt passthrough like 'claw explain this' must still work). The multi-word gap is documented as ROADMAP #826 (known limitation). Tests: - unknown_subcommand_json_emits_command_not_found (new) - unknown_subcommand_text_emits_command_not_found_on_stderr (new) - unknown_subcommand_typo_with_suggestions_json_emits_command_not_found (new) - multi_word_unknown_subcommand_falls_through_to_prompt_826 (documents gap) 572 tests pass, 1 pre-existing worker_boot failure unrelated.
0236d7e to
5616f7c
Compare
|
Good catch — the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes ROADMAP #826.
Before:
claw foobar baz→missing_credentials(after provider startup)After:
claw foobar baz→command_not_found(immediate, no provider startup)Root cause: #825 guard only fired when
rest.len() == 1. Multi-word cases slipped through toCliAction::Prompt.Fix: Removed the
rest.len() == 1restriction from thelooks_like_subcommand_typoguard. Any first-word that looks like a command word but is unknown now immediately returnscommand_not_found.Tests: 1 new regression test, 572 pass.